<template>
  <div class="main">
    <div class="daohang">
      <div class="daohangNav">
        <div class="dhNavheader">按纲施训落实动态</div>
        <div
          class="dhNavtext"
          @click="navClick(false, index)"
          v-for="(item, index) in list"
          :key="index"
        >
          {{ item }}
        </div>
      </div>
      <div class="daohangNav">
        <div class="dhNavheader">训练水平智能分析</div>
        <div
          class="dhNavtext"
          @click="navClick(true, index)"
          v-for="(item, index) in list"
          :key="index"
        >
          {{ item }}
        </div>
      </div>
      <div class="daohangNav">
        <div class="dhNavheader">智慧训练辅助决策</div>
        <div
          class="dhNavtext"
          @click="navClick(false, index)"
          v-for="(item, index) in list"
          :key="index"
        >
          {{ item }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "rukou",
  data() {
    return {
      list: ["整旅", "建制营", "建制连", "单个人员"],
    };
  },
  components: {},
  updataed() {},
  mounted() {
    let loginType = sessionStorage.getItem("loginType");
    if (loginType == "true") {
    } else {
      setTimeout(() => {
        this.$notify({
          title: "警告",
          message: "请你先登录",
          type: "warning",
        });
      }, 500);
      setTimeout(() => {
        this.$router.push("/login");
      }, 500);
    }
  },
  methods: {
    navClick(type, index) {
      if (type) {
        if (index == 0) {
          this.$router.push("/index");
        } else if (index == 1) {
          this.$router.push("/jianzhi");
        } else {
          this.$notify({
            title: "提示",
            message: "您没有该模块权限",
            type: "warning",
          });
        }
      } else {
        this.$notify({
          title: "提示",
          message: "您没有该模块权限",
          type: "warning",
        });
      }
    },
  },
};
</script>

<style scoped>
@import "./css/main.css";
</style>

